package com.lvmama.rhino.web;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("page")
public class PageController {

	
	@RequestMapping("login")
	public String login(){
		if(SecurityUtils.getSubject().isAuthenticated()) {
			return "redirect:/user/index";
		}
		
		return "login";
	}
	
	@RequestMapping("{pageName}")
	public String pageSkip(@PathVariable("pageName")String pageName){
		if("index".equals(pageName)){
			return "redirect:/page/login";
		}
		return "application/"+pageName;
}
}
